package day04;

import org.junit.Test;

import java.util.Scanner;

public class scannerTest {
    public static void main(String[] args) {
        Scanner sr=new Scanner(System.in);
//        System.out.println(sr.nextInt());
        System.out.println("请输入字符串：");
        String str = sr.next();
        System.out.println(str);
    }

    //@Test
    public void test1(){
        System.out.println("输出随机产生的几个随机数：（-10-99）");
        for (int i=0;i<8;i++){
            int ran = (int)(Math.random()*110-10);
            System.out.print(ran+"\t");
        }
    }

    @Test
    public void test2(){
        System.out.println("测试switch case：");
        Scanner sc = new Scanner(System.in);
       // String s = sc.next();
        //int a = sc.nextInt();
        int a = 3;
        switch (a){
            case 23:
                System.out.println(23);
                break;
            case 34:
                System.out.println(34);
                break;
            default:
                System.out.println(a);
        }
        System.out.println("执行结束了");
    }
}
